//
//  DataManagement.h
//  reacticons
//
//  Created by Nong Nghia on 4/14/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ManagedItems.h"
#import "Items.h"
#define kUpdateDatabaseFinishNotification @"kUpdateDatabaseFinishNotification"

@interface DataManagement : NSObject
{
    NSMutableArray * myCategories;
}

// tumblr

-(void)requestListItemFromTumblr;

// data manager
-(NSMutableArray*)getCategories;

- (NSMutableArray*)readAllItemsFromEntity:(NSString*)entityName;

- (NSMutableArray*)readItemsFromEntity:(NSString*)entityName WithType:(NSString*)type;

- (NSMutableArray*)readItemsFromEntity:(NSString*)entityName WithName:(NSString*)name AndType:(NSString*)type AndParentID:(NSString*)parentID;

- (NSMutableArray*)readRecentlyItemsWithType:(NSString*)recentlyItemType;

- (BOOL)writeAnItem:(Items*)item ToEntity:(NSString*)entityName Immediatly:(BOOL)now;

- (BOOL)updateAnItem:(Items*)item ToManagedItem:(ManagedItems*)managedItem Immediatly:(BOOL)now;

- (BOOL)updateAnItem:(Items*)item inEntityWithName:(NSString *)entityName;

- (BOOL)writeListItems:(NSMutableArray*)list ToEntity:(NSString*)entityName;

- (NSMutableArray*)readItemsFromEntity:(NSString*)entityName WithName:(NSString*)name AndType:(NSString*)type AndParentID:(NSString*)parentID orderBy:(NSString*)orderField ascending:(BOOL)ascending;

-(NSMutableArray*)getFavoriteList;

-(NSMutableArray*)getMemeList;


@end
